import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Input,
  Output,
  TemplateRef,
  ViewEncapsulation,
} from '@angular/core';
import { ApesCalendarI18nInterface } from '@shared/apes/i18n';


import { CandyDate } from '../candy-date/candy-date';
import { isTemplateRef, isNonEmptyString } from '@shared/apes/core';

@Component({
  selector: 'calendar-footer',
  exportAs: 'calendarFooter',
  templateUrl: 'calendar-footer.component.html',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CalendarFooterComponent {
  @Input() locale: ApesCalendarI18nInterface;
  @Input() showToday: boolean = false;
  @Input() hasTimePicker: boolean = false;
  @Input() isRange: boolean = false;

  @Input() showTimePicker: boolean = false;
  @Output() showTimePickerChange = new EventEmitter<boolean>();

  // @Input() disabled: boolean = false;
  @Input() timePickerDisabled: boolean = false;
  @Input() okDisabled: boolean = false;
  @Input() disabledDate: (d: Date) => boolean;
  @Input() extraFooter: TemplateRef<void> | string;
  @Input() rangeQuickSelector: TemplateRef<void>;

  @Output() clickOk = new EventEmitter<void>();
  @Output() clickToday = new EventEmitter<CandyDate>();

  prefixCls: string = 'apes-calendar';
  isTemplateRef = isTemplateRef;
  isNonEmptyString = isNonEmptyString;
}
